package springmvc34;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import po.Student;
import po.StudentExt;

@Controller
@RequestMapping("/stu")
public class StudentController {
    @RequestMapping("register.do")
    public String register(){return "/user/register";}
    @RequestMapping("addstu")
    public String addstudent()(String username){
        System.out.println((username));
        model.addAttribute("username",username);
      return "/user/userList";
    }
    @RequestMapping("addstu1")
    public String addStudent1(Student student){
        System.out.println(student);
        return "/user/userList";
    }
    @RequestMapping("addstu2")
    public String addStudent2(StudentExt ext){
        System.out.println(ext);
        return "/user/userList";}
    @RequestMapping("test")
    public String test() {return "redirect:register.do";}
    @Controller
    @RequestMapping("/stu")
    public String StudentController{
        @RequestMapping("register.do")
                public String register(){return"/user/register";}
    @RequestMapping("addStu")
            public String addStudent(String username,){
            System.out.println(username);
            model.addAttribute("username",username);
            return "/user/userList";
        }


    }
}
